﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PSU.Models
{
    public class RepositorioTema: IRepositorio<Tema>
    {
        private psuDBDataContext db = new psuDBDataContext();

        public IQueryable<Tema> FindAll()
        {
            return db.Temas;
        }

        public Tema Get(int id)
        {
            return db.Temas.SingleOrDefault(d => d.IdTema == id);
        }

        public void Add(Tema ob)
        {
            db.Temas.InsertOnSubmit(ob);
        }

        public void Delete(Tema ob)
        {
            db.Temas.DeleteOnSubmit(ob);
        }

        public void Save()
        {
            db.SubmitChanges();
        }
    }
}